//index.js
//获取应用实例
const app = getApp()
var t = require("../../api.js"), a = getApp();
Page({
  data: {
    state: false,
    first_click: false,
    order:{},
    type: ''
  },

  toggle: function () {
    var list_state = this.data.state,
      first_state = this.data.first_click;
    if (!first_state) {
      this.setData({
        first_click: true
      });
    }
    if (list_state) {
      this.setData({
        state: false
      });
    } else {
      this.setData({
        state: true
      });
    }
  },
  onLoad:function (e){
    var o = this;
    o.setData(e)
    a.request({
      url: t.order.share_detail,
      data: {
        order_id: e.order_id,
        type : e.type ? e.type : ''
      },
      success: function (t) {
        0 == t.code && o.setData({
          order: t.data
        });
      },
      complete: function () {
        wx.hideLoading();
      }
    });
  },
  onShow:function (){
    var user_info = wx.getStorageSync('user_info');
    var that = this;
  }
 
})
